/*
 * This is a widget for APP footer
 */
import QtQuick 2.0
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12

Rectangle{
    id:rectangleFooter
    //color:"grey"
    height: 40

    property alias labelMsg: labelMsg

    MyClock {
        id: myClock
        x: 5
        anchors{
            verticalCenter: parent.verticalCenter
        }
    }

    Label{
        id:labelMsg
        text: "My footer"
        anchors{
            left:myClock.right
            leftMargin: 10
            verticalCenter: parent.verticalCenter
        }
    }

    ToolBar{
        RowLayout{
            ToolButton{action:actionError}
            ToolButton{action:actionKits}
            ToolButton{action:actionSpell}
            ToolButton{action:actionRefresh}
        }
        anchors{
            horizontalCenter: parent.horizontalCenter
            verticalCenter: parent.verticalCenter
        }
    }

    ToolBar{
        RowLayout{
            ToolButton {
                text: qsTr("‹")
                //onClicked: stack.pop()
            }
            ToolButton{action:actionChart}
            ToolButton{action:actionSearch}
            ToolButton{action:actionLogin}
            ToolButton {
                text: qsTr("⋮")
                //onClicked: menu.open()
            }
        }
        anchors{
            right:parent.right
            leftMargin: 50
            verticalCenter: parent.verticalCenter
        }
    }
    Action{
        id:actionRefresh
        text: "🔃Refresh"
        //tooltip: "To Do -🔃Refresh"
        onTriggered: {
            console.log("To do -🔃Refresh")
            labelMsg.text="To do -🔃Refresh"
        }
    }
    Action{
        id:actionSpell
        text: "✔️Spell"

        //tooltip: "To Do -✔️Spell"
        onTriggered: {
            console.log("To do -✔️Spell")
            labelMsg.text="To do -✔️Spell"
        }
    }

    Action{
        id:actionKits
        text: "💼Kits"
        //tooltip:"To Do -💼Kits. text"
        //tooltip: "To Do -💼Kits"
        onTriggered: {
            console.log("To do -💼Kits")
            labelMsg.text="To do -💼Kits"
        }
    }
    Action{
        id:actionError
        text: "⛔Error"
        //tooltip: "To Do -⛔Error"
        onTriggered: {
            console.log("To do -⛔Error")
            labelMsg.text="To do -⛔Error"
        }
    }

    Action{
        id:actionChart
        text: "📈Chart"
        //tooltip: "To Do -📈Chart"
        onTriggered: {
            console.log("To do -📈Chart")
            labelMsg.text="To do -📈Chart"
        }
    }
    
    Action{
        id:actionSearch
        text: "🔍Search"
        //tooltip: "To Do -🔍Search"
        onTriggered: {
            console.log("To do -🔍Search")
            labelMsg.text="To do -🔍Search"
        }
    }

    Action{
        id:actionLogin
        text: "👤Login"
        //tooltip: "To Do -Login"
        onTriggered: {
            console.log("To do -👤Login")
            labelMsg.text="To do -👤Login"
        }
    }
}
